package kr.saeildamil.androidstudy_second.ani;

import kr.saeildamil.androidstudy_second.R;
import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

public class FrameAni extends Activity {
	AnimationDrawable mAni;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch23_frameani);

		ImageView img = (ImageView) findViewById(R.id.ch23_frameani_babydrum);
		mAni = (AnimationDrawable) img.getBackground();

		img.post(new Runnable() {
			@Override
			public void run() {
				mAni.start();
			}
		});

	}

	public void mOnClick(View v) {
		switch (v.getId()) {
		case R.id.ch23_frameani_start:
			mAni.start();
			break;
		case R.id.ch23_frameani_stop:
			mAni.stop();
			break;

		}
	}
}
